<template>
	<!-- 充币详情 -->
	<view class="charge-detail-box">
		<nav-bar :title="i18n.charge.detail" @_back="_back" />
		<view class="container">
			<view class="detail-box">
				<view class="left-box">
					<text>{{i18n.charge.time}}</text>
				</view>
				<view class="right-box">
					<text>{{info.create_time}}</text>
				</view>
			</view>
			<view class="detail-box">
				<view class="left-box">
					<text>{{i18n.charge.number}}</text>
				</view>
				<view class="right-box">
					<text>{{info.number}}</text>
				</view>
			</view>
			<view class="detail-box">
				<view class="left-box">
					<text>{{i18n.mention.currency}}</text>
				</view>
				<view class="right-box">
					<text>{{info.currency_name}}</text>
				</view>
			</view>
			<view class="detail-box">
				<view class="left-box">
					<text>{{i18n.charge.chain}}</text>
				</view>
				<view class="right-box">
					<text>{{info.links}}</text>
				</view>
			</view>
			<view class="detail-box">
				<view class="left-box">
					<text>{{i18n.charge.walletAddress}}</text>
				</view>
				<view class="right-box">
					<text>{{info.address}}</text>
				</view>
			</view>
			<view class="detail-box">
				<view class="left-box">
					<text>{{i18n.charge.status}}</text>
				</view>
				<view class="right-box">
					<text>{{info.status | type(i18n)}}</text>
				</view>
			</view>
			<view class="screen">
				<view class="left-box">
					<text>{{i18n.charge.screenshot}}</text>
				</view>
				<view class="right-box">
<!-- 					<image class="right-box-image" v-for="(item, index) in info.screenshot" :key="index" :src="item" mode="widthFix"></image> -->
					<image class="right-box-image"  :src="info.upimg" mode="widthFix"></image>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import NavBar from '@/components/NavBar/index.vue'
	import { walletIn_Info } from '@/api/index.js'
	import { mapGetters } from 'vuex'
	export default {
		components: {
			NavBar
		},
		filters: {
			type(val,i18n) {
				let name = '';
				switch (val) {
					case 2:
					name = i18n.common.fail;
					break;
					case 1:
					name = i18n.common.pending;
					break;
					case 3:
					name = i18n.common.success;
					break;
				}
				return name;
			}
		},
		data() {
			return {
				info: {}
			}
		},
		computed: {
			...mapGetters(['token']),
			i18n() {
				return this.$t('message');
			},
		},
		onLoad(data) {
			this.loadList(data.id)
		},
		methods: {
			_back() {
				uni.navigateBack();
			},
			async loadList(id) {
				let {error, res} = await walletIn_Info({id: id});
				if (error) return;
				this.info = res;
				// this.info.upimg = [res.upimg]
			}
		}
	}
</script>

<style lang="scss">
	.charge-detail-box {
		font-size: 28rpx;
		& > .container {
			margin-top: 32rpx;
		}
		.detail-box {
			height: 84rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;
			border-bottom: 1px solid rgba(255, 255, 255, .1);
			.left-box {
				color: rgba(255, 255, 255, .54);
			}
			.right-box {
				color: #fff;
			}
		}
		.screen {
			.left-box {
				color: rgba(255, 255, 255, 1);
				margin: 62rpx 0 32rpx;
			}
			.right-box-image {
				width: 332rpx;
				&:first-child {
					margin-right: 24rpx;
				}
			}
		}
	}
</style>
